package kotlincode


fun String?.getLastElement(): Char? {
    if (this?.isEmpty() == true) {
        return null
    }
    return this?.get(length - 1)
}

fun main() {
    testExtension01()
}

private fun testExtension01() {
    println("LwwwwwwwwwwwwwwwwL".getLastElement())
    val str: String? = null
    println(str.getLastElement())
}
